package com.football;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoComparerActivity extends Activity {
	
	private VideoView video;
	private VideoView myVideo;	
	private MediaController mc;
	private MediaController mc2;
	private static final String TAG = "Football";
	private static final String MY_VIDEO_PATH = "myVideoPath";
	private static final String VIDEO_MP4 = "videoMp4";
	
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		
        // Get values between activities
        Bundle extras = getIntent().getExtras();
        String myVideoPath = extras.getString(MY_VIDEO_PATH);
        String videoURL = extras.getString(VIDEO_MP4);
        
		try {			
			setContentView(R.layout.compare);
			
			// Display the tutorial video 
			video = (VideoView) findViewById(R.id.video);
			video.setVideoPath(videoURL); //MP4 file streaming from a server 
			mc = new MediaController(this);
			video.setMediaController(mc);
			video.start();
			
			// Display the recorded own video
			myVideo = (VideoView) findViewById(R.id.my_video);
			myVideo.setVideoPath(myVideoPath);
			mc2 = new MediaController(this);
			myVideo.setMediaController(mc2);
			myVideo.start();
			
		} catch (Exception e) {
			Log.e(TAG, e.toString());
			e.printStackTrace();
		}
	}
}
